<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
#(companyNameMsg) #(companyAddressMsg)#(companyChargeMsg)#(chargePhoneMsg)
<form action="" method="post" >
    <input type="text" name = "authenticate.company_name"  value="一个公司"><br/>
    <input type="text" name = "authenticate.company_address"  value="地址"><br/>
    <input type="text" name = "authenticate.company_charge"  value="法人"><br/>
    <input type="text" name = "authenticate.company_charge_phone"  value="18612235770"><br/>
    <input type="hidden" name = "authenticate.company_license"  id="license_val" value=""><br/>
    <input type="hidden" name = "authenticate.legal_idcard_front" id="idcardFront_val"  value=""><br/>
    <input type="hidden" name = "authenticate.legal_idcard_tails" id="idcardTails_val" value=""><br/>
    <input type="hidden" name = "authenticate.charge_card" id="chargeCard_val"  value=""><br/>
    <input type="submit" value="提交">
</form>
<div id="license">
    营业执照<input type="file" id="license_file" /><br/>
</div>
<div id="idcardFront">
身份证正面<input type="file"  id="idcardFront_file" /><br/>
    </div>
<div id="idcardTails">
身份证反面<input type="file" id="idcardTails_file" /><br/>
    </div>
<div id="chargeCard">
名片<input type="file" id="chargeCard_file"/><br/>
    </div>
<script type="text/javascript">
    var contextPath = "#(contextPath)";
</script>
<script type="text/javascript" src="#(contextPath)/assets/front/web/script/plupload/moxie.min.js"></script>
<script type="text/javascript" src="#(contextPath)/assets/front/web/script/plupload/plupload.min.js"></script>
<script type="text/javascript" src="#(contextPath)/assets/front/web/script/qiniu/qiniu.js"></script>
<script type="text/javascript" src="#(contextPath)/assets/front/web/script/upload/auth.js"></script>
<script type="text/javascript">






    function change() {
        var pic = document.getElementById("preview"),
                file = document.getElementById("f");

        var ext=file.value.substring(file.value.lastIndexOf(".")+1).toLowerCase();

        // gif在IE浏览器暂时无法显示
        if(ext!='png'&&ext!='jpg'&&ext!='jpeg'){
            alert("图片的格式必须为png或者jpg或者jpeg格式！");
            return;
        }
        var isIE = navigator.userAgent.match(/MSIE/)!= null,
                isIE6 = navigator.userAgent.match(/MSIE 6.0/)!= null;

        if(isIE) {
            file.select();
            var reallocalpath = document.selection.createRange().text;

            // IE6浏览器设置img的src为本地路径可以直接显示图片
            if (isIE6) {
                pic.src = reallocalpath;
            }else {
                // 非IE6版本的IE由于安全问题直接设置img的src无法显示本地图片，但是可以通过滤镜来实现
                pic.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='image',src=\"" + reallocalpath + "\")";
                // 设置img的src为base64编码的透明图片 取消显示浏览器默认图片
                pic.src = '';
            }
        }else {
            html5Reader(file);
        }
    }

    function html5Reader(file){
        var file = file.files[0];
        var reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function(e){
            var pic = document.getElementById("preview");
            pic.src=this.result;
        }
    }
</script>
</body>
</html>